#include <iostream>
#include <vector>
#include "level_zero.h"
#include "entry.h"
#include <vector>

int main() {
  std::string dir = "./data";
  VirtualR::LevelZero *level_zero = new VirtualR::LevelZero(dir);

  VirtualR::SkipList *mem1 = new VirtualR::SkipList();
  std::string temp = "zys_test";
  for (int i = 0; i < 100; i++) {
    mem1->put(temp + std::to_string(i), "hhh" + std::to_string(i));
  }

  VirtualR::SkipList *mem2 = new VirtualR::SkipList();
  temp = "ys_test";
  for (int i = 0; i < 100; i++) {
    mem2->put(temp + std::to_string(i), "zhhh" + std::to_string(i));
  }
  std::cout << "begin add mem1" << std::endl;
  level_zero->add(*mem1, 6);
  std::cout << "begin add mem2" << std::endl;
  level_zero->add(*mem2, 7);

  std::pair<bool, std::string> value = level_zero->search("ys_test66");
  std::cout << value.first << " " << value.second << std::endl;
  level_zero->get_index_content_for_debug();

  std::vector<VirtualR::Entry_t> entry_continer_ = level_zero->get_all_entry(); 
  std::cout << "=====================" << std::endl;
  for (auto x : entry_continer_) {
    std::cout << x.key << ":" << x.value << std::endl;
  }

  return 0;
}